import Vue from 'vue'
import App from './App.vue'
import VCharts from 'v-charts'
import '@/utils/filter'
import moment from 'moment'
import '@/icons' // icon
import {
  Row,
  Col,
  // Row,
  // Col,
  Switch,
  Button,
  ButtonGroup,
  Select,
  Option,
  Icon,
  Input,
  InputNumber,
  Dialog,
  Upload,
  Radio,
  RadioGroup,
  Pagination,
  Loading,
  Message,
  MessageBox,
  Tabs,
  TabPane,
  Table,
  TableColumn,
  Checkbox,
  CheckboxGroup,
  // CheckboxButton,
  // Form,
  // Tabs,
  Popover,
  Tooltip,
  Form,
  FormItem,
  DatePicker,
  Timeline,
  TimelineItem,
  // TimePicker
  Tree
} from 'element-ui'
import './styles/element-variables.scss'
Vue.use(Row)
Vue.use(Col)
Vue.use(ButtonGroup)
Vue.use(Checkbox)
Vue.use(CheckboxGroup)
Vue.use(VCharts)
// Vue.use(CheckboxButton)
// Vue.use(Row)
// Vue.use(Col)
Vue.use(Button)
Vue.use(Select)
Vue.use(Option)
Vue.use(Icon)
Vue.use(Input)
Vue.use(InputNumber)
Vue.use(Dialog)
Vue.use(Upload)
Vue.use(Radio)
Vue.use(RadioGroup)
Vue.use(Pagination)
Vue.use(Tabs)
Vue.use(Table)
Vue.use(TableColumn)
// Vue.use(Form)

// Vue.use(Tabs)
Vue.use(Popover)
Vue.use(Tooltip)
Vue.use(Form)
Vue.use(Switch)
Vue.use(FormItem)
Vue.use(TabPane)
Vue.use(DatePicker)
Vue.use(TimelineItem)
Vue.use(Timeline)
// Vue.use(TimePicker)
Vue.use(Tree)
Vue.use(Loading.directive)
Vue.prototype.$loading = Loading.service
Vue.prototype.$msgbox = MessageBox
Vue.prototype.$alert = MessageBox.alert
Vue.prototype.$confirm = MessageBox.confirm
Vue.prototype.$prompt = MessageBox.prompt
Vue.prototype.$message = Message
Vue.prototype.$moment = moment
import { handleTree, parseTime } from "@/utils/common";
import router from './router'
import store from './store'
Vue.prototype.hasBtn = (id) => {
  const btnArr = localStorage.getItem('BtnIds').split(',')
  return btnArr.indexOf(id) !== -1
}
if (window.screen.height < 800) {
  console.log('ok')
  Vue.prototype.screenHight = window.screen.height * 0.5
} else {
  Vue.prototype.screenHight = window.screen.height * 0.65
}
Vue.prototype.handleTree = handleTree
Vue.prototype.parseTime = parseTime

import components from '@/components/components.js'
Vue.use(components)

import './styles/common.css'
import './styles/fonts/iconfont.css'
import '@/utils/rem'

Vue.config.productionTip = false

new Vue({
  router,
  store,
  render: h => h(App)
}).$mount('#app')

// store.dispatch('aaa')
